import React,{useState} from 'react'

export default function StateHook() {
  const [num,setNum]=useState(0)
  return (
    <div>
        <div>{num}</div>
        <button onClick={()=>{
            setNum(function(arg){
                return num+1
            })
            setNum(num=>num+5)
            setNum(num=>num+3)
            setNum(num=>num+2)
        }}>+</button>
    </div>
  )
}
